// DlgHookFile.cpp : implementation file
//

#include "stdafx.h"
#include "dlltool.h"
#include "DlgHookFile.h"
#include "HOOKFILE.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgHookFile dialog


CDlgHookFile::CDlgHookFile(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgHookFile::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgHookFile)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDlgHookFile::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgHookFile)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgHookFile, CDialog)
	//{{AFX_MSG_MAP(CDlgHookFile)
	ON_BN_CLICKED(IDC_BN_ATTACH_DELETEFILE_RET, OnBnAttachDeletefileRet)
	ON_BN_CLICKED(IDC_BN_ATTACH_CREATEFILE, OnBnAttachCreatefile)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgHookFile message handlers

void CDlgHookFile::OnBnAttachDeletefileRet() 
{
	// TODO: Add your control notification handler code here
	int nret = HookAndRetDeleteFile();
	switch(nret)
	{
	case 1:
		::SetWindowText(::GetDlgItem(this->m_hWnd,IDC_BN_ATTACH_DELETEFILE_RET),"UnAndRetDeleteFile"); 
		break;
	case 2:
		::SetWindowText(::GetDlgItem(this->m_hWnd,IDC_BN_ATTACH_DELETEFILE_RET),"AndRetDeleteFile"); 
		break;
	default:
		break;
	}
}

void CDlgHookFile::OnBnAttachCreatefile() 
{
	// TODO: Add your control notification handler code here
	
	int nret = HookCreatefile();
	switch(nret)
	{
	case 1:
		::SetWindowText(::GetDlgItem(this->m_hWnd,IDC_BN_ATTACH_DELETEFILE_RET),"UnAndRetDeleteFile"); 
		break;
	case 2:
		::SetWindowText(::GetDlgItem(this->m_hWnd,IDC_BN_ATTACH_DELETEFILE_RET),"AndRetDeleteFile"); 
		break;
	default:
		break;
	}
}
